<admintpl file="header" />
</head>
<body>
    <div class="wrap js-check-wrap">
        <ul class="nav nav-tabs">
     		<li><a href="{:U('Analysis/index')}">数据汇总</a></li>
     		<li><a href="{:U('Analysis/day')}">单日统计</a></li>
            <li><a href="{:U('Analysis/activity')}">活动统计</a></li>
            <li><a href="{:U('Analysis/materials')}">物料统计</a></li>
            <li class="active"><a href="{:U('Analysis/equipment')}">设备统计</a></li>
            <li><a href="{:U('Analysis/users')}">用户统计</a></li>
            <li><a href="{:U('Analysis/winning')}">中奖记录</a></li>
            <li><a href="{:U('Analysis/withdraw')}">提现记录</a></li>
            <li><a href="{:U('Analysis/logs')}">摇摇记录</a></li>
            <li><a href="{:U('Analysis/urls')}">链接记录</a></li>
        </ul>
        <form class="well form-search js-ajax-form" method="post" action="{:U('Analysis/equipment')}">

            商家类型：
            <select name="bstype" style="width: 100px;">
                <foreach name="btypes" item="vo">
                    <option <if condition="(I('param.bstype') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            查询类型：
            <select name="search" style="width: 100px;">
                <foreach name="search" item="vo">
                    <option <if condition="(I('param.search') eq $vo['id'])" >selected</if> value="{$vo.id}">{$vo.name}</option>
                </foreach>
            </select>
            查询内容：
            <input type="text" name="keyword" style="width: 100px;" value="{:I('param.keyword')}" placeholder="请输入查询内容...">
            时间范围：
            <input type="text" name="start_time" class="js-date" value="{:I('param.start_time')}" style="width: 80px;" autocomplete="off"> ~
            <input type="text" name="end_time" class="js-date"  value="{:I('param.end_time')}" style="width: 80px;" autocomplete="off">

            <input type="submit" class="btn btn-primary" value="搜索" />
            <if condition="$count" >共查询到 {$count} 条数据</if>
        	<button class="btn btn-primary js-ajax-submit" type="submit" data-action="{:U('Analysis/outequipmentcsv')}">查询导出</button>

        </form>
   <if condition="I('param.')" >以上条件查询<else />昨日</if>汇总数据：
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                        <th>活动数</th>
                        <th>摇一摇次数</th>
                        <th>摇一摇人数</th>
                        <th>中奖数</th>
                        <th>未中奖数</th>
                        <th>红包数</th>
                        <th>红包金额(元)</th>
                        <th>卡券数</th>
                        <th>实物数</th>
                        <th>使用设备</th>
                        <th>活跃设备</th>
                        <th>点击链接数</th>
                        <th>点击链接人数</th>
                    </tr>
                </thead>
                <foreach name="tsum" item="vo">
                    <tr>
                        <td>{$vo.activitys}</td>
                		<td>{$vo.click_pv}</td>
                		<td>{$vo.click_uv}</td>
                		<td>{$vo.winning}</td>
                		<td>{$vo.nowinning}</td>
                		<td>{$vo.reds}</td>
                		<td>{$vo['moneys']/100}</td>
                		<td>{$vo.cards}</td>
                		<td>{$vo.reals}</td>
                		<td>{$vo.uses}</td>
                		<td>{$vo.active}</td>
                		<td>{$vo.hits}</td>
                		<td>{$vo.people}</td>
                    </tr>
                </foreach>
            </table><br>
   <if condition="I('param.')" >以上条件查询<else />每日</if>数据：
            <table class="table table-hover table-bordered">
                <thead>
                    <tr>
                    	<th>设备ID</th>
                        <th>时间/活动数</th>
                        <th>摇一摇次数/摇一摇人数</th>
                        <th>中奖数/未中奖数</th>
                        <th>红包数/红包金额</th>
                        <th>卡券数/实物数</th>
                        <th>店铺名称/店铺类型</th>
                        <th width="400">店铺地区/店铺地址</th>
                    </tr>
                </thead>
                <foreach name="analysis" item="vo">
                    <tr>
                        <td>{$vo.device_id}</td>
                        <td>{$vo.datetime}<br>{$vo.activitys}</td>
                		<td>{$vo.click_pv}<br>{$vo.click_uv}</td>
                		<td>{$vo.winning}<br>{$vo.nowinning}</td>
                		<td>{$vo.reds}<br>{$vo.moneys}</td>
                		<td>{$vo.cards}<br>{$vo.reals}</td>
                        <td>{$vo.bsname}<br>
                        	<foreach name="btypes" item="bts">
								<if condition="$bts['id'] eq $vo['bstype']" >{$bts.name}</if>
                        	</foreach>
                        </td>
                		<td>
                        	<foreach name="region" item="pid">
								<if condition="$pid['code'] eq $vo['province_id']" >{$pid.name} - </if>
								<if condition="$pid['code'] eq $vo['city_id']" >{$pid.name}</if>
								<if condition="$pid['code'] eq $vo['district_id']" > - {$pid.name}</if>
                        	</foreach>
                        	<br>{$vo.bsaddress}</td>
                    </tr>
                </foreach>
                <thead>
                    <tr>
                    	<th>设备ID</th>
                        <th>时间/活动数</th>
                        <th>摇一摇次数/摇一摇人数</th>
                        <th>中奖数/未中奖数</th>
                        <th>红包数/红包金额</th>
                        <th>卡券数/实物数</th>
                        <th>店铺名称/店铺类型</th>
                        <th width="400">店铺地区/店铺地址</th>
                    </tr>
                </thead>
            </table>
            <div class="pagination">{$page}</div><br />
    <script src="__PUBLIC__/js/common.js"></script>
</body>
</html>